package com.zhanghu.backendZray.controller.member;

import com.zhanghu.backendZray.pojo.dto.ApiResponse;
import com.zhanghu.backendZray.pojo.vo.MemberInfoVo;
import com.zhanghu.backendZray.service.MemberService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 会员表 前端控制器
 * </p>
 *
 * @author zhangdong
 * @since 2024-08-09
 */
@RestController
@RequestMapping("/member")
@RequiredArgsConstructor
public class MemberController {
    private final MemberService memberService;

    /**
     * 当前用户会员信息
     */
    @GetMapping("currentUserMemberInfo")
    public ApiResponse<MemberInfoVo> currentUserMemberInfo() {
        MemberInfoVo memberInfoVo = memberService.currentUserMemberInfo();
        return ApiResponse.ok(memberInfoVo);
    }

}
